#!/bin/zsh

# Run this script with a system wide LaunchAgent

###############################
# DO NOT EDIT BELOW THIS LINE #
###############################

log_level=6

function log_to_system {

        syslog -s -l $log_level "FileWave: com.filewave.blockmacosinstall.notify; $1"
        log_level="Info"
}

current_user=$(stat -f%Su /dev/console)


the_language=$(defaults read -g AppleLanguages | awk -F "\"" '/\"/ {print $2; exit}')

if [ -z $the_language ]
then
	the_language=en
else
	the_language="${the_language%%-*}"
fi

log_to_system "Informing user: ${current_user}, with language ${the_language}"

/usr/local/etc/Pashua.app/Contents/MacOS/Pashua /usr/local/etc/block_macos_updates/warning_${the_language}.txt

exit 0
